﻿<link rel="stylesheet" href="~/assets/plugins/owl-carousel/owl-carousel/owl.carousel.css">
<link rel="stylesheet" href="~/assets/css/pages/portfolio-v2.css">
<!--=== Breadcrumbs ===-->
<div class="breadcrumbs">
    <div class="container">
        <h1 class="pull-left">院校咨询</h1>
        <ul class="pull-right breadcrumb">
            <li><a href="/home/index">首页</a></li>
            <li class="active">院校咨询</li>
        </ul>
    </div><!--/container-->
</div><!--/breadcrumbs-->
<!--=== End Breadcrumbs ===-->
<!--=== Breadcrumbs v3 ===-->
<div class="breadcrumbs-v3 img-v1">
    <div class="container text-center">
        <p>Portfolio</p>
        <h1>Single Item</h1>
    </div><!--/end container-->
</div>
<!--=== End Breadcrumbs v3 ===-->
<!--=== Content Part ===-->
<div class="container content">
    <!-- Portfolio Sorting Blocks -->

    <div class="col-md-3">
        <!-- Social Icons -->
        <div class="magazine-sb-social margin-bottom-20">
            <div class="headline headline-md"><h2>获签公告</h2></div>
            <div align="center" id="demo" class="tab-v2 tab-content" style="overflow:hidden;height:100px;">
                <div id="demo1" style="text-align:left">
                </div>
                <div id="demo2" style="text-align:left"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <!-- End Social Icons -->
        <!-- Posts -->
        <div class="posts margin-bottom-40" id="recentPost">
            <div class="headline headline-md"><h2>最新消息</h2></div>

        </div><!--/posts-->
        <div class="tab-v2 margin-bottom-40">
            <ul class="nav nav-tabs">
                <li class="active"><a data-toggle="tab" href="#home-1">联系我们</a></li>
            </ul>
            <div class="tab-content">
                <div id="home-1" class="tab-pane active">
                    <i class="fa fa-home" aria-hidden="true"><p style="display: inline-block;">&nbsp; 123 Rd, Suburb City Country 1234</p></i><br>
                    <i class="fa fa-envelope" aria-hidden="true"><p style="display: inline-block;">&nbsp; Example@email.com</p></i><br>
                    <i class="fa fa-phone" aria-hidden="true"><p style="display: inline-block;">&nbsp; 123456789</p></i><br>
                    <i class="fa fa-globe" aria-hidden="true"><p style="display: inline-block;">&nbsp; www.example.com</p></i>
                </div>
            </div>
        </div>
        <!-- End Tabs Widget -->
    </div>
    <div class="sorting-block">
        <div class="content-xs">
            <ul class="sorting-nav sorting-nav-v1 text-center">
                <li class="filter" data-filter="all">ALL</li>
                <li class="filter" data-filter="NSW">NSW</li>
                <li class="filter" data-filter="ACT">ACT</li>
                <li class="filter" data-filter="VIC">VIC</li>
                <li class="filter" data-filter="WA">WA</li>
            </ul>
        </div>

        <ul class="row sorting-grid" id="schoollist"></ul>

        <div class="clearfix"></div>
    </div>
    <!-- End Portfolio Sorting Blocks -->
</div><!--/container-->
<!--=== End Content Part ===-->

@section scripts{
    <script type="text/javascript" src="~/assets/plugins/jquery.mixitup.min.js"></script>
    <script type="text/javascript" src="~/assets/js/pages/page_portfolio.js"></script>
    <script>

        $(function () {
            $.post('/data/selectnews', {categoryid:@(ViewBag.Id),pageIndex:1,pageSize:1000}, function (data) {
                $("#schoollist").html("");
                console.log(data)
                if(data){
                    for(var key in data){
                        var html = '<li class="col-md-3 col-sm-6 col-xs-12 mix '+data[key].Tag+'" data-cat="1">'
                        +'<a href="/news/detail/'+data[key].NewId+'">'
                            +'<img class="img-responsive" src="'+data[key].ImgUrl+'" alt="">'
                            +'<span class="sorting-cover">'
                                +'<span>'+data[key].Title+'</span>'
                            +'</span>'
                        +'</a>'
                    +'</li>';
                        $("#schoollist").append(html);
                    }
                    PortfolioPage.init();
                }
            })


        })


        loadScroll();
        function loadScroll(){
            $.post('/data/selectconfig',{configkey:'scrolly'},function(data){

                if(data){
                    var html=[];
                    for(var key in data){
                        html.push(data[key].Title+'<br>')
                    }

                    $("#demo1").html(html.join(''))
                    scrollgo();
                }
            })
        }

        loadData();
        function loadData() {
            $.post('/data/SelectAllNews',{pageIndex:1,pageSize:3},function(data){
                if(data){
                    var recentPost = [];
                    for(var key in data){
                        var html = ' <dl class="dl-horizontal">'
                    +'<dt><a href="/news/detail/'+data[key].NewId+'"><img src="'+data[key].ImgUrl+'" alt="" /></a></dt>'
                    +'<dd>'
                       +' <p><a href="/news/detail/'+data[key].NewId+'">'+data[key].Title+'</a></p>'
                    +'</dd>'
                +'</dl>';
                        recentPost.push(html)
                    }
                    $("#recentPost").append(recentPost)

                }
            })
        }

        function scrollgo(){

            var demo = document.getElementById("demo");
            var demo1 = document.getElementById("demo1");
            var demo2 = document.getElementById("demo2");
            var speed=50;    //数值越大滚动速度越慢
            demo2.innerHTML = demo1.innerHTML;
            demo.scrollTop = demo.scrollHeight+'px';

            function Marquee(){
                var i =demo.scrollTop;
                demo.scrollTop++;
                //向下的无缝循环滚动
                if(demo2.offsetTop-demo.scrollTop<=0 || i ==  demo.scrollTop)    //当滚动至demo1与demo2交界时
                {
                    demo.scrollTop-=demo1.offsetHeight;    //demo跳到最顶端
                }
                //else{
                //    demo.scrollTop++;
                //}
            }
            var MyMar = setInterval(Marquee,speed);
            demo.onmouseover = function(){clearInterval(MyMar)}
            demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
        }


    </script>
}